import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
Vue.use(VueRouter)
const routes = [
  {
    path: '/home',
    name: 'home',
    component: HomeView,

    //重定向cat页面
    redirect:'/commodityList',
    //表示home的子页面
    children:[
      {
        path: '/commodity/:petType',
        name: 'commodity',
        component: () => import('../views/commodity/Commodity.vue')
      },
      {
        name:'commodityList',
        path:'/commodityList',
        component:()=>import('../views/commodity/commodityList')
      },
      {
        name:'customer',
        path:'/customer',
        component:()=>import('../views/customer/customer')
      },
      {
        name:'addCustomer',
        path:'/customer/add',
        component:()=>import('../views/customer/addCustomer')
      },
      {
        name:'rabbitAndCustomer',
        path:'/rabbit',
        component:()=>import('../views/customer/rabbitAndCustomer')
      },
      {
        name:'rabbitAndCustomer',
        path:'/rabbit/add',
        component:()=>import('../views/customer/addRabbit')
      },
      {
        name:'RS',
        path:'/raisingSkillsDO/query',
        component:()=>import('../views/raisingSkills/raisingSkills')
      },
      {
        name:'ARS',
        path:'/raisingSkillsDO/add',
        component:()=>import('../views/raisingSkills/addRaisingSkills')
      },
      {
        name:'LC',
        path:'/lifeCourseDO/query',
        component:()=>import('../views/lifeCourse/lifeCourse')
      },
      {
        name:'strategy',
        path:'/strategy',
        component:()=>import('../views/emergencyStrategy/strategy')
      },
      {
        name:'drugDisplay',
        path:'/drugDisplay',
        component:()=>import('../views/emergencyStrategy/drugDisplay')
      },
      {
        name:'DRB',
        path:'/DailyRabbitBreeding',
        component:()=>import('../views/dailyRabbitBreeding/DailyRabbitBreeding')
      },  {
        path:'/login',
        name:'login',
        component:()=>import('../views/login/Login')
      },
    ],
  },
  {
    path: '/',
    name: 'home',
    // component: () => import('../views/commodity/commodityList')
    component: () => import('../views/HomeView')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
